package com.service.impl;

import com.mapper.DictionaryMapper;
import com.pojo.Dictionary;
import com.service.DictionaryService;
import com.util.Pager;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service("dictionaryService")
public class DictionaryServiceImpl implements DictionaryService {
    @Resource
    private DictionaryMapper dictionaryMapper;

    @Override
    public Pager<Dictionary> searchByDictionaryPager(Pager<Dictionary> pager) {
        pager.setRows(dictionaryMapper.searchByDictionaryPager(pager));
        pager.setTotal(dictionaryMapper.total(pager));
        return pager;
    }

    @Override
    public int add(Dictionary dictionary) {
        return dictionaryMapper.add(dictionary);
    }

    @Override
    public int update(Dictionary dictionary) {
        return dictionaryMapper.update(dictionary);
    }
}
